/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package FarmacieDAL;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "ARHIVA")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Arhiva.findAll", query = "SELECT a FROM Arhiva a"),
    @NamedQuery(name = "Arhiva.findByData", query = "SELECT a FROM Arhiva a WHERE a.data = :data"),
    @NamedQuery(name = "Arhiva.findByCantitate", query = "SELECT a FROM Arhiva a WHERE a.cantitate = :cantitate"),
    @NamedQuery(name = "Arhiva.findByIdArhiva", query = "SELECT a FROM Arhiva a WHERE a.idArhiva = :idArhiva")})
public class Arhiva implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "DATA")
    @Temporal(TemporalType.TIMESTAMP)
    private Date data;
    @Column(name = "CANTITATE")
    private Integer cantitate;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_ARHIVA")
    private Integer idArhiva;
    @JoinColumn(name = "ID_MEDICAMENT", referencedColumnName = "ID_MEDICAMENT")
    @ManyToOne
    private Medicament idMedicament;

    public Arhiva() {
    }

    public Arhiva(Integer idArhiva) {
        this.idArhiva = idArhiva;
    }

    public Date getData() {
        return data;
    }

    public void setData(Date data) {
        this.data = data;
    }

    public Integer getCantitate() {
        return cantitate;
    }

    public void setCantitate(Integer cantitate) {
        this.cantitate = cantitate;
    }

    public Integer getIdArhiva() {
        return idArhiva;
    }

    public void setIdArhiva(Integer idArhiva) {
        this.idArhiva = idArhiva;
    }

    public Medicament getIdMedicament() {
        return idMedicament;
    }

    public void setIdMedicament(Medicament idMedicament) {
        this.idMedicament = idMedicament;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idArhiva != null ? idArhiva.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Arhiva)) {
            return false;
        }
        Arhiva other = (Arhiva) object;
        if ((this.idArhiva == null && other.idArhiva != null) || (this.idArhiva != null && !this.idArhiva.equals(other.idArhiva))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "FarmacieDAL.Arhiva[ idArhiva=" + idArhiva + " ]";
    }
    
}
